//
//  LAMapSource.m
//  LAMapBasicDemo
//
//  Created by 罗亮富 on 2017/6/16.
//  Copyright © 2017年 2Bulu. All rights reserved.
//

#import "LAMapSource.h"

@implementation LAMapSource

-(instancetype)initWithUUID:(NSString *)uuid
{
    self = [super init];
    if (self) {
        _uuid = uuid;
        self.tileSize = 256;
        self.minZoomScale = 1;
        self.maxZoomScale = 23;
    }
    return self;
}

- (instancetype)init
{
    
    self = [self initWithUUID:@"pdaidiada"];
    if (self) {
        
        
    }
    return self;
}


-(BOOL)isEqual:(id)object{
    
    if ((self == object) || (object && [object isKindOfClass:self.class] && [[(LAMapSource *)object uuid] isEqual:self.uuid])) {
        return YES;
    }
    return NO;
    
}

+(NSString *)nameOfCoordinateSystem:(LACoordinateSystem)coordinateSystem
{
    if(coordinateSystem == LACoordinateSystemWGS84){
        return NSLocalizedString(@"GPS坐标", nil);
    }else if (coordinateSystem == LACoordinateSystemGCJ02){
        return NSLocalizedString(@"国标坐标系", nil);
    }else if (coordinateSystem == LACoordinateSystemBD09){
        return NSLocalizedString(@"百度坐标", nil);
    }
    
    return nil;
    
}


- (id)copyWithZone:(NSZone *)zone
{
    LAMapSource *theCopy = [[[self class] allocWithZone:zone] init];
    [theCopy copyPropertiesFromSourceObject:self];
    
    
    return theCopy;
}

-(void)copyPropertiesFromSourceObject:(LAMapSource *)sourceObject
{
    if(sourceObject == self)
        return;
    
    [self setUuid:[sourceObject.uuid copy]];
    [self setIcon:[sourceObject.icon copy]];
    [self setName:[sourceObject.name copy]];
    [self setSourceDescription:[sourceObject.sourceDescription copy]];
    [self setTileUrlTemplate:[sourceObject.tileUrlTemplate copy]];
    [self setMinZoomScale:sourceObject.minZoomScale];
    [self setMaxZoomScale:sourceObject.maxZoomScale];
    [self setCoordinateSystem:sourceObject.coordinateSystem];
    [self setTileSize:sourceObject.tileSize];
    [self setContourNorColor:sourceObject.contourNorColor];
    [self setContourHighLightColor:sourceObject.contourHighLightColor];
    [self setTrackNetColor:sourceObject.trackNetColor];
    [self setIsSystemMapSource:sourceObject.isSystemMapSource];
}


@end
